import request from "./request"

export const GetAddr = (x) => request.get("/api/v2/pois/" + x);

// 获取食品分类
export const CategoryList = async () => await request.get("/api/v2/index_entry");

// 商铺列表
export const StoreList = async (params) => await request.get("/api/shopping/restaurants", {
    params: {
        latitude: params.latitude,  // 纬度
        longitude: params.longitude,    // 经度
        offset: params.offset,  // 起始条目位置
        limit: params.limit,    // 默认获取条目数
        restaurant_category_id: params.restaurant_category_id,
        order_by: params.order_by,
        delivery_mode: params.delivery_mode,
        support_ids: params.support_ids,
        restaurant_category_ids: params.restaurant_category_ids
    }
});

// 商铺详情页
export const StoreDetail = async (params) => await request.get("/api/shopping/restaurant/" + params.shopId);

// 食品列表
export const FoodList = async (id) => await request.get("/api/shopping/v2/menu", {params: {restaurant_id: id}});

// 获取评分列表
export const EvaluationList = async (id) => await request.get("/api//ugc/v2/restaurants/" + id + "/ratings/scores");

// 获取评价分类
export const EvaluationCategroy = async (id) => await request.get("/api/ugc/v2/restaurants/" + id + "/ratings/tags");

// 获取评价信息
export const EvaluationMessage = async (params) => await request.get("/api/ugc/v2/restaurants/"+ params.id +"/ratings",
{
    params: {
        limit: params.limit,
        offset: params.offset,
        tag_name: params.tag_name
    }
});